<!--
*Author：DGZ
 *Contact：jiduxiong@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/wmsproject/order/Wms_Order.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/wmsproject/order/Wms_Order.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        name: "Wms_Order",
        setup() {
            const table = ref({
                key: "OrderId",
                footer: "Foots",
                cnName: "仓库单据",
                name: "order/Wms_Order",
                newTabEdit: false,
                url: "/Wms_Order/",
                sortName: "OrderDate,OrderStatus"
            });
            const editFormFields = ref({"WarehouseId":"","OrderTypeId":"","OrderNo":"","OrderDate":"","VendorId":"","CustomId":"","Remarks":""});
            const editFormOptions = ref([[{"dataKey":"WMS_Warehouse","data":[],"title":"仓库","field":"WarehouseId","type":"select"},
                               {"dataKey":"WMS_OrderType","data":[],"title":"单据类型","field":"OrderTypeId","type":"select"},
                               {"title":"单号","field":"OrderNo","disabled":true}],
                              [{"title":"单据日期","field":"OrderDate","type":"date"},
                               {"dataKey":"BASE_Vendor","data":[],"title":"供应商","field":"VendorId","type":"select"},
                               {"dataKey":"BASE_Customer","data":[],"title":"客户","field":"CustomId","type":"select"}],
                              [{"title":"备注","field":"Remarks","colSize":12,"type":"textarea"}]]);
            const searchFormFields = ref({"OrderTypeId":[],"OrderNo":"","PrintStatus":""});
            const searchFormOptions = ref([[{"title":"单号","field":"OrderNo","type":"like"},{"dataKey":"WMS_OrderType","data":[],"title":"单据类型","field":"OrderTypeId","type":"selectList"}],[{"dataKey":"enabled","data":[],"title":"打印状态","field":"PrintStatus","type":"select"}]]);
            const columns = ref([{field:"WarehouseId",title:"仓库",type:"bigint",bind:{ key:"WMS_Warehouse",data:[]},width:110,fixed:true,showOverflowTooltip:true,align:"left"},
                       {field:"OrderId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"OrderTypeId",title:"单据类型",type:"bigint",bind:{ key:"WMS_OrderType",data:[]},width:140,fixed:true,showOverflowTooltip:true,align:"left"},
                       {field:"OrderNo",title:"单号",type:"string",link:true,width:160,readonly:true,fixed:true,showOverflowTooltip:true,align:"left"},
                       {field:"OrderDate",title:"单据日期",type:"datetime",width:140,showOverflowTooltip:true,align:"left"},
                       {field:"VendorId",title:"供应商",type:"bigint",bind:{ key:"BASE_Vendor",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"CustomId",title:"客户",type:"bigint",bind:{ key:"BASE_Customer",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"AuditStatus",title:"审核状态",type:"int",bind:{ key:"AuditStatus",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"AuditUser",title:"单据审核人",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"OrderStatus",title:"单据状态",type:"int",bind:{ key:"WMS_OrderStatus",data:[]},width:110,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"AuditTime",title:"审核时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"CancelStatus",title:"是否作废",type:"int",bind:{ key:"enabled",data:[]},width:110,showOverflowTooltip:true,align:"left"},
                       {field:"CancelUser",title:"作废人",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"CancelTime",title:"作废时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"OrderTypeConfId",title:"单据类型仓库",type:"bigint",width:110,hidden:true,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"FifoControl",title:"先进先出控制",type:"int",bind:{ key:"enabled",data:[]},width:110,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"InOutType",title:"出入库类型",type:"int",bind:{ key:"WMS_InOutOrderType",data:[]},width:110,readonly:true,showOverflowTooltip:true,align:"left"},
                       {field:"ErpOrderId",title:"erp单据id",type:"string",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"PushStatus",title:"推送状态",type:"int",bind:{ key:"WMS_MesPushTaskStatus",data:[]},width:110,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"PushMessage",title:"推送信息",type:"string",width:140,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Enabled",title:"是否启用",type:"int",bind:{ key:"enabled",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"PrintStatus",title:"打印状态",type:"int",bind:{ key:"enabled",data:[]},width:120,showOverflowTooltip:true,align:"left"},
                       {field:"ErpOrderTypeId",title:"erp真实单据类型",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:120,showOverflowTooltip:true,align:"left"}]);
            const detail = ref(  {
                    cnName: "单据明细",
                    table: "Wms_OrderDetail",
                    columns: [{field:"OrderDetailId",title:"ID",type:"bigint",width:110,hidden:true,readonly:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"OrderId",title:"单号ID",type:"bigint",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"OrderNo",title:"单号",type:"string",bind:{ key:"WMS_Order",data:[]},width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ItemOrder",title:"项次",type:"int",width:110,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"MaterialId",title:"物料",type:"bigint",bind:{ key:"WMS_Material",data:[]},width:160,edit:{type:"select"},showOverflowTooltip:true,align:"left"},
                       {field:"RequestDate",title:"需求日期",type:"datetime",width:110,edit:{type:"date"},showOverflowTooltip:true,align:"left"},
                       {field:"RequestQty",title:"需求数量",type:"decimal",width:110,edit:{type:"number"},showOverflowTooltip:true,align:"left"},
                       {field:"RequestLotNo",title:"需求批次号",type:"string",width:180,edit:{type:""},showOverflowTooltip:true,align:"left"},
                       {field:"IqcId",title:"检验单id",type:"bigint",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"IqcStatus",title:"入库单检验状态",type:"int",bind:{ key:"WMS_IqcStatus",data:[]},width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Remarks",title:"备注",type:"string",width:150,showOverflowTooltip:true,align:"left"},
                       {field:"IsValid",title:"是否有效",type:"int",width:110,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"CreateId",title:"创建用户",type:"bigint",width:80,hidden:true,require:true,showOverflowTooltip:true,align:"left"},
                       {field:"Creator",title:"创建人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"CreateTime",title:"创建时间",type:"datetime",width:110,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyId",title:"修改用户",type:"bigint",width:80,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"Modifier",title:"修改人",type:"string",width:100,showOverflowTooltip:true,align:"left"},
                       {field:"ModifyTime",title:"修改时间",type:"datetime",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"ActualQty",title:"实际发生数量",type:"decimal",width:120,showOverflowTooltip:true,align:"left"},
                       {field:"ErpOrderId",title:"ErpOrderId",type:"bigint",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ErpDetailId",title:"ERP表明细ID",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ErpLotId",title:"ERP批次id",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ErpProductUomId",title:"ErpProductUomId",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ErpProductUomName",title:"ErpProductUomName",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ErpLocationId",title:"源位置id",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ErpLocationName",title:"源位置名称",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ErpLocationDestId",title:"目的位置id",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"},
                       {field:"ErpLocationDestName",title:"目的位置名称",type:"string",width:120,hidden:true,showOverflowTooltip:true,align:"left"}],
                    sortName: "OrderDetailId",
                    key: "OrderDetailId"
                                            });
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
